home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2003 July / CD 2 Debian 3.0r1 / Debian.iso / isolinux / root.bin / root / bin / extdisk < prev    next >
Encoding:
Text File  |  2002-03-07  |  866 b   |  43 lines

  1. #!/bin/sh -e
  2.  
  3. nr=1
  4. while [ -e /ext$nr ] ; do
  5.    nr=`expr $nr + 1`
  6. done
  7.  
  8. ramdisk=/dev/ram$nr
  9.  
  10. if [ $# = 2 ] ; then
  11.    echo Decompressing extension filesystem from $1 to $2, please wait...
  12.    zcat $1 > $2
  13.    ramdisk=$2
  14.    
  15. elif [ $# = 1 ] ; then
  16.    echo Decompressing extension filesystem from $1 to $ramdisk, please wait...
  17.    zcat $1 > $ramdisk
  18.    
  19. else
  20.    echo Trying the floppy drives, please wait...
  21.    zcat /dev/fd0 >$ramdisk || zcat /dev/fd1 >$ramdisk || (
  22.      echo "No compressed volume found in /dev/fd0 or /dev/fd1!"
  23.      echo "Usage: extdisk VOLUME RAMDEVICE"
  24.      echo "example: extdisk /mnt/pppoedisk.gz /dev/ram1"
  25.      exit 1
  26.    )
  27. fi
  28.  
  29. echo Locating a new mount point...
  30.  
  31. nr=1
  32. while [ -e /ext$nr ] ; do
  33.    nr=`expr $nr + 1`
  34. done
  35.  
  36. mkdir /ext$nr
  37.  
  38. mount $ramdisk /ext$nr
  39. if [ -x /ext$nr/autorun ] ; then
  40.    export EXTDIR=/ext$nr
  41.    /ext$nr/autorun setup
  42. fi
  43.